<%@ Page ValidateRequest="false" Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeFile="CreateEditTable.aspx.cs" Inherits="CreateEditTable" Title="<%$Resources:web.sitemap, CreateEditTable.Title %>" %>
<%@ Register TagPrefix="Location" TagName="Database" Src="~/Toolbars/DatabaseLocation.ascx" %>
<%@ Register TagPrefix="Location" TagName="Server" Src="~/Toolbars/ServerLocation.ascx" %>
<%@ Register TagPrefix="Toolbar" TagName="HelpLogout" Src="~/Toolbars/HelpLogoutToolbar.ascx" %>
<%@ Register TagPrefix="CSControls" Namespace="SqlWebAdmin.CSharp.Controls" %>
<asp:Content ID="Content0" runat="server" ContentPlaceHolderID="defaultScript">
    <script type="text/javascript" src="CreateEditTable.js" />
</asp:Content>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="breadcrumb">
    <Location:Server Runat="Server" id="ServerLocation"></Location:Server>
    <Location:Database Runat="Server" id="DatabaseLocation" IsActive="true"></Location:Database>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="NavigationPane">
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="ContentPane">
    <div class="RightCenterWell">
	    <table cellSpacing="0" cellPadding="0" border="0" width="100%">
            <tr>
                <td valign="top">
                    <asp:Image ID="icon_tables_32" SkinID="icon_tables_32" runat="Server" />
                </td>
                <td>
                    <span class="header3"><asp:literal text="<%$Resources: LocalizedText,CreateTable_Title %>" runat="server" /></span>
                    <hr />
                    <p>
                   <asp:literal text="<%$Resources: LocalizedText,CreateTable_Instruction %>" runat="server" /></p>
                    <br />
                    <br />
                    <hr />
                    <span class="header4"> <asp:literal text="<%$Resources: LocalizedText,CreateTable_NameTableLabel %>" runat="server" /></span>
                    <div>
                        <table width="100%">
                            <tr>
                                <td width="200px"><asp:literal ID="Literal1" text="<%$Resources: LocalizedText,CreateTable_SchemaInstruction %>" runat="server" /></td>
                                <td>
                                    <asp:TextBox id="txtSchemaName" runat="server" Columns="30" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Runat="server" ErrorMessage="<%$Resources: LocalizedText,CreateTable_ErrorEmptySchemaName %>"
                                        Display="Dynamic" ControlToValidate="txtSchemaName">
                                    </asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td><asp:literal ID="Literal3" text="<%$Resources: LocalizedText,CreateTable_NameTableInstruction %>" runat="server" /></td>
                                <td>
                                    <asp:TextBox id="txtTableName" runat="server" Columns="30"></asp:TextBox>
            						<asp:RequiredFieldValidator Runat="server" ID="rfvTableName" ControlToValidate="txtTableName" Display="Dynamic" ErrorMessage="<%$Resources: LocalizedText,CreateTable_ErrorEmptyTableName %>"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <asp:Label id="lblError" runat="server" Visible="False" ForeColor="red"></asp:Label>
                    <hr />
                    <span class="header4"><asp:literal ID="Literal2" text="<%$Resources: LocalizedText,CreateTable_AddColumns %>" runat="server" /></span>
                    <br />
					<div style="width:660px">
                        <div class="TableGrid">
                            <table id="tableStructure" class="editTable" border="1" cellpadding="2" cellspacing="0" width="98%" >
			                    <tr>
				                    <th class="TableHeader"><asp:literal text="<%$Resources: LocalizedText,CreateTable_ColumnKey %>" runat="server" /></th>
				                    <th class="TableHeader"><asp:literal text="<%$Resources: LocalizedText,CreateTable_ColumnID %>" runat="server" /></th>
				                    <th class="TableHeader"><asp:literal text="<%$Resources: LocalizedText,CreateTable_ColumnName %>" runat="server" /></th>
				                    <th class="TableHeader"><asp:literal text="<%$Resources: LocalizedText,CreateTable_ColumnDataType %>" runat="server" /></th>
				                    <th class="TableHeader"><asp:literal text="<%$Resources: LocalizedText,CreateTable_ColumnSize %>" runat="server" /></th>
				                    <th class="TableHeader"><asp:literal text="<%$Resources: LocalizedText,CreateTable_ColumnNulls %>" runat="server" /></th>
				                    <th class="TableHeader"><asp:literal text="<%$Resources: LocalizedText,CreateTable_ColumnDelete %>" runat="server" /></th>
				                    <th class="TableHeader"><asp:literal text="<%$Resources: LocalizedText,CreateTable_ColumnAdvanced %>" runat="server" /></th>
                                </tr>
                            </table>
                        </div>
                        <div style="width:620px;">
                            <hr />
                            <span class="header4"><asp:literal ID="Literal4" text="<%$Resources: LocalizedText,CreateTable_AdvancedColumnSettings %>" runat="server" /></span>
                            <div id="advancedSettings" style="display:none;width:620px;">
                                <table cellpadding="2" cellspacing="0" border="0" width="100%" cols="6">
                                    <tr>
                                        <td colspan="3"><asp:literal ID="Literal5" text="<%$Resources: LocalizedText,CreateTable_AdvancedText %>" runat="server" /></td>
                                        <td width="40px">&nbsp;</td>
                                        <td><asp:literal ID="Literal6" text="<%$Resources: LocalizedText,CreateTable_IdentitySeed %>" runat="server" /></td>
                                        <td><input type="text" id="txtIdentitySeed" value="1" size="10" onchange="Handle_IdentitySeedOnChange(this)" /></td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" nowrap><input type="text" id="txtUdtSchema" size="10" onchange="Handle_UdtSchemaOnChange(this)" />-<input type="text" id="txtUdtName" size="10" onchange="Handle_UdtNameOnChange(this)" />&nbsp;<asp:literal ID="Literal12" text="<%$Resources: LocalizedText,CreateTable_SchemaSyntax %>" runat="server" /></td>
                                        <td>&nbsp;</td>
                                        <td><asp:literal ID="Literal7" text="<%$Resources: LocalizedText,CreateTable_IdentityIncrement%>" runat="server" /></td>
                                        <td><input type="text" id="txtIdentityIncrement" size="10" onchange="Handle_IdentityIncrementOnChange(this)" /></td>
                                    </tr>
                                    <tr>
                                        <td colspan="3"><asp:literal ID="Literal8" text="<%$Resources: LocalizedText,CreateTable_DefaultValue %>" runat="server" /></td>
                                        <td><img src="~/App_Themes/default/images/spacer.gif" width="40" runat="server" /></td>
                                        <td colspan="2" width="100%" ><input type="checkbox" id="chkRowGuid" size="10" onchange="Handle_RowGuidOnChange(this)" /><asp:literal ID="Literal9" text="<%$Resources: LocalizedText,CreateTable_IsRowGuid %>" runat="server" /></td>
                                    </tr>
                                    <tr>
                                        <td colspan="6"><input type="text" id="txtDefaultValue" size="20" onchange="Handle_DefaultValueOnChange(this)" /></td>
                                    </tr>
                                    <tr>
                                        <td><asp:literal ID="Literal10" text="<%$Resources: LocalizedText,CreateTable_Precision %>" runat="server" /></td>
                                        <td><input type="text" id="txtPrecision" size="10" onchange="Handle_PrecisionOnChange(this)" /></td>
                                        <td colspan="4">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td><asp:literal ID="Literal11" text="<%$Resources: LocalizedText,CreateTable_Scale %>" runat="server" /></td>
                                        <td><input type="text" id="txtScale" size="10" onchange="Handle_ScaleOnChange(this)" /></td>
                                        <td colspan="4">&nbsp;</td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                    <br />
                    <asp:HiddenField ID="txtTableXml" runat="server" />
                    <asp:Button ID="btnSave" OnClientClick="Handle_PreSubmit(this)" Text="Save" runat="server" />&nbsp;&nbsp;<asp:Button ID="btnCancel" Text="Cancel" runat="server" />
			    </td>
		    </tr>
	    </table>
	</div>
</asp:Content>
